using System;
using System.Collections.Generic;
using System.ComponentModel;
using UltraLight.MVVM.Contracts;

namespace UltraLight.MVVM
{    
    /// <summary>
    ///     Base view model for data-binding
    /// </summary>
    public abstract class BaseViewModel : BaseNotify, IViewModel
    {        
        /// <summary>
        ///     True if in the designer
        /// </summary>
        protected bool InDesigner
        {
            get
            {
                return DesignerProperties.IsInDesignTool;
            }
        }

        /// <summary>
        ///     To to visual state 
        /// </summary>
        public virtual Action<string, bool> GoToVisualState { get; set; }

        /// <summary>
        ///     Back request
        /// </summary>
        /// <returns>Used to process a back request. Return true to cancel.</returns>
        public virtual bool CancelBackRequest()
        {
            return false;
        }

        /// <summary>
        ///     Navigation go back
        /// </summary>
        public Action GoBack { get; set; }
        
        /// <summary>
        ///     Dialog
        /// </summary>
        public IDialog Dialog { get; set; }

        /// <summary>
        ///     Request a navigation event
        /// </summary>
        public Action<string> RequestNavigation { get; set; }

        /// <summary>
        ///     For pages, the list of commands to bind to application bar buttons
        /// </summary>
        public abstract IEnumerable<IActionCommand<object>> ApplicationButtonBindings { get; }

        /// <summary>
        ///     For pages, the list of commands to bind to application menu items
        /// </summary>
        public abstract IEnumerable<IActionCommand<object>> ApplicationMenuBindings { get; }
        
    }
}